package entity;

public class Manager extends Employee {
    private double monthlySalary; // 月薪
    private double bonus; // 奖金

    public Manager(String name, String empId, double monthlySalary, double bonus) {
        super(name, empId);
        this.monthlySalary = monthlySalary;
        this.bonus = bonus;
    }

    @Override
    public double calculateSalary() throws Exception {
        if (monthlySalary < 0 || bonus < 0) {
            throw new Exception("薪资/奖金不能为负数");
        }
        return monthlySalary + bonus;
    }
}